-module(rest_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
-define(SERVER, ?MODULE). % macro that just defines this module as server

start_link() ->
    supervisor:start_link({local, ?SERVER},?MODULE, []).

init([]) ->
    Restart = {rest_for_one, 5, 1000},
    ChildSpec1 = {child1,
                  {rest_serv1, start_link, []},
                  temporary,
                  3000,
                  worker,
                  [rest_serv1]},
    ChildSpec2 = {child2,
                  {rest_serv2, start_link, []},
                  temporary,
                  3000,
                  worker,
                  [rest_serv2]},
    Children = [ChildSpec1, ChildSpec2],
    SupervisorSpec = {Restart, Children},
    {ok, SupervisorSpec}.
